package Data;

import java.io.Serializable;

public class CellData implements Serializable{

		public int sampleTot; // Number of units of sample that are contained in this cell.
		public Boolean obstacle; // True if cell contains an obstacle; Agent can't go there.
		public Boolean isHome;  // True if cell is the home base 
		public Boolean crumb;
		public int siganlPower;
		
		public CellData()
		{
			sampleTot = 0;
			obstacle = false;
			isHome = false;
		}
		
		public CellData(int s, Boolean o)
		{
			sampleTot = s;
			obstacle = o;
		}
		
		// Pick up amt if possible.  
		// Return actual amount picked up
		public int pickUpLoad(int amt)
		{
			if (sampleTot == 0)
				return 0;
			if (sampleTot <= amt)
			{
				amt = sampleTot;
			}
			sampleTot -= amt;
			return amt;
		}
		
		// Drop amt
		public void  dropLoad(int amt)
		{
			sampleTot += amt;
		}
		
		// return true if cell contains sample
		public Boolean hasSample()
		{
			return sampleTot > 10;
		}

		public Boolean hasAnything()
        {
            return  sampleTot> 0;
        }
		
		public Boolean isObstacle()
		{
			return obstacle;
		}
}
